package 蓝桥杯.第十三届蓝桥杯大赛软件赛省赛Java大学B组;

import java.util.Scanner;

/**
 * @Title: 星期计算
 * @Author 贾金博
 * @Package 蓝桥杯.第十三届蓝桥杯大赛软件赛省赛Java大学B组
 * @Date 2024/4/10 17:59
 * @description:
 */
public class 星期计算 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = 20, b = 22;
        long sum = ksm(a, b) ;
//        System.out.println("sum = " + sum);
//        System.out.println("sum = " + sum);
        long t = 6;
        for(int i = 1; i <= sum; ++ i ) {
            t ++ ;
            if(t == 8) {
                t = 1;
            }
        }
        System.out.println(t);
    }

    public static long ksm(int a, int b) { //
        long ret = 1;
        while(b != 0 ) {
            if((b & 1) == 1) {
                ret = ret * a;
            }
            a = a * a;
            a = a % 7;
            b = b >> 1;
        }
        return ret;
    }
}
